<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>有两⽇期，⽐较两个⽇期是否相同</title>
</head>
<body>

    <script>
        var num =new Date('2022-10-12')
        var obj=new Date('2022-10-11')
        console.log(num-obj==0)
    </script>
</body>
</html>